<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery-3.6.1.js"></script>
	</head>
	<body>
		<input type="text" name="uname" value="张三">
		<div>博为峰</div>
		<script type="text/javascript">
			//-----------------固有属性--------------------------------
			//获取
			let type = $('input').prop('type');
			// console.log(type);
			//设置
			// $('input').prop('type',"checkbox");

			//-----------------自定义属性(h5,以data开始)--------------------------------
			$('div').attr('data-index', 6);

			let index = $('div').data('index');
			console.log(index);
		</script>
	</body>
</html>
